#!/bin/bash

# Iterate through all subdirectories in the current directory
for dir in */; do
  # Check if it is a directory
  if [ -d "$dir" ]; then
    # 进入子目录
    cd "$dir"
    # Check if it is a Git repository.
    if [ -d ".git" ]; then
      echo "Checking Git status in $dir"
      git status
      echo "--------------------------------"
    else
      echo "$dir is not a Git repository"
      echo "--------------------------------"
    fi
    # Return to parent directory
    cd ..
  fi
done
